//懒汉模式
public class SingletonLazy {
    private static volatile SingletonLazy instance ;
    private SingletonLazy(){
        if(instance!=null){
          throw  new IllegalMonitorStateException("instance has already created");
        }
    }
    public static SingletonLazy getSingletonLazy(){
        if(instance==null){
            synchronized (SingletonLazy.class){
                instance = new SingletonLazy();
            }
        }
        return instance;
    }
}
